import request from '@/utils/request'



// 初始化租户
export function initConnect(data) {
  return request({
    method: 'POST',
    url: `/tenant/tenant/initConnect`,
    data: data
  })
}


// 查询所有租户
export function listTenant(query) {
  return request({
    url: '/tenant/tenant/list',
    method: 'get',
    params: query
  })
}


// 新增租户
export function addTenant(data) {
  return request({
    url: '/tenant/tenant',
    method: 'post',
    data: data
  })
}


// 修改租户
export function updateTenant(data) {
  return request({
    url: '/tenant/tenant',
    method: 'put',
    data: data
  })
}

// 删除租户
export function delTenant(tenantId) {
  return request({
    url: '/tenant/tenant/' + tenantId,
    method: 'delete'
  })
}

// 导出租户
export function exportTenant(query) {
  return request({
    url: '/tenant/tenant/export',
    method: 'get',
    params: query
  })
}


// 检查租户
export function checkTenant(code) {
  return request({
    url: `/tenant/tenant/check/${code}`,
    method: 'GET'
  })
}


// 根据TenantCode获取租户信息
export function getCTenantByTenantCode(code) {
  return request({
    url: `/tenant/tenant/selectCTenantByTenantCode/${code}`,
    method: 'GET'
  })
}



// 预览租户
export function previewTenant(data) {
  return request({
    url: `/tenant/tenant/preview`,
    method: 'POST',
    data:data
  })
}



// 修改租户状态
export function updateTenantStatus(tenantIds,data) {
  return request({
    url: `/tenant/tenant/status/` + tenantIds,
    method: 'POST',
    data:data,
    formData: true,
  })
}

